using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Finance.Web.Models.Mapping
{
    public class BankMap : EntityTypeConfiguration<Bank>
    {
        public BankMap()
        {
            // Primary Key
            this.HasKey(t => t.Code);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(1024);

            // Table & Column Mappings
            this.ToTable("BANK");
            this.Property(t => t.Code).HasColumnName("BANKCODE");
            this.Property(t => t.Name).HasColumnName("NAME");
            this.Property(t => t.Info).HasColumnName("INFO");

        }
    }
}
